package com.gyf.dao;

import com.gyf.model.User;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Repository
public class UserDaoImpl extends JdbcDaoSupport implements IUserDao{



    @Override
    public void add(User user) {

        System.out.println("dao 添加用户:" + user);

        getJdbcTemplate().update("insert t_user (username,password) values (?,?)",user.getUsername(),user.getPassword());
    }
}
